0 votes

Hello,

I need to know if a category has been deactivated in the edit context.

I try to use the following methods in the WF (beforeCommit) but they don't allow me to know if the category has been deactivated or not in the current context :
- CategoryModified : returns false
- OldCategoryFieldValue : returns an empty string
- GetCategoryDataSet : returns a dataset
- .IsEmpty : returns true

I wonder if this information is stored in the dataset or if Efficy provides a way to know this ?

Thank you,

Regards,
Pierre.

asked in WorkFlow / Serverscript by (114 points)

1 Answer

0 votes

Hello Pierre.

I typically do these two nested checks to know if the category is activated for the provided contexthandle and if it is accessible by the current user. Table rights also matter so the latter one is also important.

function IsCategoryActived(editHandle, category) {
  var dsCatg = Database.GetCategoryDataSet(editHandle, category);
  return (dsCatg && !dsCatg.isEmpty)
}
answered by (6.8k points)
Thank you for your answer.

I already use these two checks but this let me know if the category is activated or not in the contexthandle.

How can I know the "status" of the category (activated/deactivated) at the beginning of the edit operation ?

My goal is to know if the category was activated and if it is now deactivated.
1,167 questions
1,425 answers
1,717 comments
325 users