Hi.
When you say "Ticket" I suppose you mean Change Orders as OOB there is no CI tab on R/I/P.
That will depend on what release you are on as at a time CA changed from LREL to BREL
This was working fine using the asset.length until CA decided to move with BREL and because for a new ticket there is no data committed to the foreign table yet.
For our change management we overcome this by making the CI required moving from RFC to something else
Below quick pseudo code to adapt to your needs.
trigger:
//using a low number as we don't want any another trigger to commit data if we are returning error here
POST_VALIDATE z_ci_required(status) 10 FILTER (status{});
spl:
chg::z_ci_required(...) {
if(event() == "UPDATE") {
string zoldstatus;
string znewstatus;
zoldstatus = argv[2];
znewstatus = argv[3];
if(zoldstatus != 'RFC' && (zoldstatus != znewstatus)){
send_wait(0, top_object(), "call_attr", "lrel_asset_chgnr", "sync_fetch", "RLIST_STATIC", format("chg = %d", this.id), -1, 0);
if(msg[1] == 0){
string zmsg;
zmsg=format("At least 1 Configuration Item is required in tab 2 Additional Information under tab 4 Configutaions Items prior to move from '%s' status", status.sym);
set_error(1);
set_return_data(zmsg);
return;
}
}
}
return;
};
Hope this help
/J