Help with creating report
Collapse
X
-
Try this
PHP Code:if (entity\isAttributeChanged('contactsCategoriesIds')) {
$contact_id = id;
description = $contact_id;
}
Also you need to have Link Multiple Field enabled on your relationship otherwise it won't work. -
Guys im having a problem in my formula to register if attribute changed... heres the code
Code:if (entity\isAttributeChanged('contactsCategories')) { $contact_id = id; description = $contact_id; }
My Contact entity relations attached as image.
Looks like entity\isAttributeChanged('contactsCategories') isn't registering attribute change, anyone got an idea what im doing wrong?Leave a comment:
-
Thanks for reply, I thought I should reference mysql table names, therefore I used them, the '' usage I did see in this forum ?. I will try to modify my code, by your instructions. Cheers ?Leave a comment:
-
you have not provide any info for someone to help. what is the relationship between the 3 entities ? also see my comments on your code below
PHP Code:ifThen(entity\isAttributeChanged('contactsCategories'),
$contact_id = id;
// This logDebug is not supported and i am not sure where did you get this, it will never work. the log is under data/logs
util\logDebug('XXX',$contact_id);
// never use '' you should use null instead and also name of the entity should be correct as ContactCategory you need to verify name under administration > entity $category_id = record\findOne('ContactCategory', null, mull, 'contact_id', $contact_id);
$category_id = record\findOne('contact_contacts_category', '', '', 'contact_id', $contact_id);
// this is also wrong fields should be spilted camelCase requiredNumberOfVisits
$number_of_visits = record\attribute('ContactCategory', $category_id, 'required_number_of_visits');
entity\setAttribute('Numberofvisits', $number_of_visits);
);
Leave a comment:
-
It seems no one can help me with this problem, can someone at least point me am I at right track how to aquire data from another entity?
ThanksLeave a comment:
-
Help with creating report
Can someone help me create report from 3 entities- Contact
- Contact Categories - which contains category name and required number of visits
- Meeting
I need to create report that prints name, required number of visits, actual visits that sales person is made.
I have tried using joint reports but without any luck.... I'm having problems connecting contact and contact categories entities...
Tried with formulas when change contact category:
Code:ifThen(entity\isAttributeChanged('contactsCategories'), $contact_id = id; util\logDebug('XXX',$contact_id); $category_id = record\findOne('contact_contacts_category', '', '', 'contact_id', $contact_id); $number_of_visits = record\attribute('contactsCategories', $category_id, 'required_number_of_visits'); entity\setAttribute('Numberofvisits', $number_of_visits); );
Also tried many to many, one to many contact to contact category, all without any luck.
Any pointers create this report / create appropriate formula. Thanks in advance.
Leave a comment: