A similar question was posted here before but it only applied to an On-Site SugarCRM instance (it was also a long time ago).
In my case I would like to change the "Billing Country" field from 'TextField' to 'DropDdown' on an On-Demand instance where I don't have access to the config files. How can I do this?
So far I have tried different PHP files using the Module Loader but it's not working either.
Please find my PHP script below:
<?php
$manifest = array(
'acceptable_sugar_flavors' => array('CE', 'PRO', 'CORP', 'ENT', 'ULT'),
'acceptable_sugar_versions' => array(
'exact_matches' => array(),
'regex_matches' => array(
0 => '6\\.5\\.(.*?)',
1 => '6\\.7\\.(.*?)',
2 => '7\\.2\\.(.*?)',
3 => '7\\.2\\.(.*?)\\.(.*?)',
4 => '7\\.5\\.(.*?)\\.(.*?)',
5 => '7\\.6\\.(.*?)\\.(.*?)'
),
),
'name' => 'Textfield to Dropdown',
'description' => 'Converting Billing Country textfield to Dropdown Field',
'author' => 'myname',
'icon' => '',
'is_uninstallable' => true,
'published_date' => '2015-01-09 19:00:00',
'type' => 'module',
'version' => '1.0',
);
$dictionary['Account']['fields']['billing_address_country']['type'] = 'enum';
$dictionary['Account']['fields']['billing_address_country']['ext1'] = 'countries_dom';
The module loads fine but there's no change after a Quick Repair. I have tried with the following variables, as well:
$dictionary['Account']['fields']['billing_address_country']['isDropDown']=yes;
and...
$dictionary['Account']['fields']['billing_address_country']['Options']='countries_dom';
Can anyone tell me what I am doing wrong? I'd appreciate any help or guidance you have. Please advise.
Cheers,
H
P.S. I am using SugarCRM On-Demand Version 7.6.1
You need to create the manifest.php file and have that point to the file(s) you want to copy/upload for customization:
manifest.php:
<?php
$manifest = array(
'built_in_version' => '7.6.1.0',
'acceptable_sugar_versions' =>
array(
0 => '',
),
'acceptable_sugar_flavors' =>
array(
0 => 'PRO',
1 => 'CORP',
2 => 'ENT',
3 => 'ULT',
),
'readme' => '',
'key' => 'SO',
'author' => 'Eric',
'description' => 'Convert Accounts Billing Country TextField to Enum',
'icon' => '',
'is_uninstallable' => true,
'name' => 'TextFieldToDropdownPkg',
'published_date' => '2016-01-10 03:01:01',
'type' => 'module',
'version' => 1452378413,
'remove_tables' => 'prompt',
);
$installdefs = array(
'id' => 'TextFieldToDropdownPkg',
'copy' => array(
0 => array(
'from' => '<basepath>/custom/Extension/modules/Accounts/Ext/Vardefs/custom_billing_address_country.php',
'to' => 'custom/Extension/modules/Accounts/Ext/Vardefs/custom_billing_address_country.php',
),
),
);
Then create:
custom/Extension/modules/Accounts/Ext/Vardefs/custom_billing_address_country.php
<?php
$dictionary['Account']['fields']['billing_address_country']['comments']='Country for primary address';
$dictionary['Account']['fields']['billing_address_country']['group']='primary_address';
$dictionary['Account']['fields']['billing_address_country']['options']='countries_dom';
$dictionary['Account']['fields']['billing_address_country']['type']='enum';
ZIP those files up and use Module Loader.
Related
I go through this documentation "https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/journalentry"
And tried to add journal entry with line having customer as shown in the below code:
$journal_entry_create['TxnDate'] = date('Y-m-d');
$journal_entry_line = array(
'Amount' => $amount,
'DetailType' => 'JournalEntryLineDetail',
'JournalEntryLineDetail' => array(
'PostingType' => Credit,
'Entity' => array(
'Type' => 'Customer',
'EntityRef' => array(
'type' => 'Customer',
'value' => "2",
'name' => 'Abc'
)
),
'AccountRef' => array(
'name' => 'Account Name',
'value' => '1'
),
)
);
$journal_entry_lines[] = $journal_entry_line;
$journal_entry_create['Line'] = $journal_entry_lines;
$journal_entry_receipt_create = QBJournalEntry::create($journal_entry_create);
$journal_entry_receipt_create_result = $dataService->Add($journal_entry_receipt_create);
Without EntityRef its working fine but when I add EntityRef its giving me error "Message: Passed array has no key for 'Value' when contructing an ReferenceType"
Only just came across this problem myself. They did fix this issue but didn't seem to document it at all or tell anyone. Found the fix in the source code. You need to use "JournalEntryEntity" instead of "Entity" under "JournalEntryLineDetail", like so:
'JournalEntryLineDetail' => array(
'PostingType' => "Credit",
'JournalEntryEntity' => array(
'Type' => 'Customer',
'EntityRef' => array(
'value' => "2"
)
),
'AccountRef' => array(
'name' => 'Account Name',
'value' => '1'
),
)
Also I used the FacadeHelper from the V3 of the PHP SDK (I'm not sure if it'll work with the method you were using):
use QuickBooksOnline\API\Facades\FacadeHelper;
...
$journal_entry_receipt_create = FacadeHelper::reflectArrayToObject('JournalEntry', $journal_entry_create);
$journal_entry_receipt_create_result = $dataService->Add($journal_entry_receipt_create);
I know this is probably too late for you OP but hopefully it helps someone else!
$options = array(
'UserData' => base64_encode('test'),
'SecurityGroupIds' => [AWS_REGIONS[$region]['security_group']],
'InstanceType' => AWS_REGIONS[$region]['instance_type'],
'ImageId' => AWS_REGIONS[$region]['ami'],
'MaxCount' => $to_launch,
'MinCount' => 1,
//'EbsOptimized' => true,
'SubnetId' => AWS_REGIONS[$region]['subnet_id'],
'Tags' => [['Key' => 'task', 'Value' => $task],['Key' => 'Name', 'Value' => $task]],
'InstanceInitiatedShutdownBehavior' => 'terminate'
);
$response = $client->runInstances($options);
I am using the "latest" Ec2Client
It launches fine but the Tags are completely ignored.
I suspect an error within the EC2 API but I am not that experienced.
Maybe someone with experience can help me out ?
This is because Ec2Client::runInstances does not have tags option
http://docs.aws.amazon.com/aws-sdk-php/v3/api/api-ec2-2015-10-01.html#runinstances
You would need to make a separate call to tag newly created instance(s) using Ec2Client::createTags:
$result = $client->createTags(array(
'DryRun' => true || false,
// Resources is required
'Resources' => array('string', ... ),
// Tags is required
'Tags' => array(
array(
'Key' => 'string',
'Value' => 'string',
),
// ... repeated
),
));
Read more here:
http://docs.aws.amazon.com/aws-sdk-php/v3/api/api-ec2-2015-10-01.html#createtags
I am trying to make the information/popuphelp icons appear in Sugarcrm V 7.6.1.0 next to text fields.
I have had these in sugar v6, but they are not appearing in v 7.6.1.0
In sugar v6 I have the following code and It worked fine but when I try the same code in sugar V7.6.1.0, It doesn't work.
Here's how my code looks like:
manifest file:
<?php
$manifest = array(
'key' => 1397052912,
'name' => 'popuphelp',
'description' => 'Adds popup help text for question in Opportunities compatible with version 7',
'author' => 'Swifty',
'version' => '1.1',
'is_uninstallable' => true,
'published_date' => '2015-10-16 14:15:12',
'type' => 'module',
'acceptable_sugar_versions' =>
array(
'regex_matches' => array(
'7\\.2\\.[0-1]$', //7.2.0 - 7.2.1
'7\\.6\\.(.*?)\\.(.*?)' //any 7.6 release
),
),
'acceptable_sugar_flavors' =>
array('CE', 'PRO', 'CORP', 'ENT', 'ULT'),
'readme' => '',
'icon' => '',
'remove_tables' => 'prompt',
);
$installdefs['vardefs'] = array(
0 => array(
'from' => '<basepath>/modules/Opportunities/Vardefs/popuphelptexts.php',
'to_module' => 'Opportunities',
),
);
popuphelptexts.php
<?php
$dictionary['Opportunity']['fields']['f10_c']['popupHelp']="Blah Blah ";
$dictionary['Opportunity']['fields']['f102_c']['popupHelp']="Blah Blah ";
$dictionary['Opportunity']['fields']['f103_c']['popupHelp']="Blah Blah ";
?>
here's how I want them to appear.
Would really appreciate your help! Thanks!!
I actualy use simpleSamlPhp for creat an authentification on my website so i have a service provider instal on my website and i also instal an Identity provider until their no problem. My service provider connect to my identity provider and connexion work fine.
I have in the file "config/authsources.php" my different user :
$config = array(
...
'example-userpass' => array(
'userTest:pwd' => array(
'uid' => array('userTest'),
'NameIdentifier' => 'Test',
'Attribut1' => 'att1',
'Attribut2' => 'att2'
)
),
...
),
...
My problem is that i want to have an attribut with several attributs in one attribut for have something like that :
$config = array(
...
'example-userpass' => array(
'userTest:pwd' => array(
'uid' => array('userTest'),
'NameIdentifier' => 'Test',
'Attribut1' => 'att1',
'Attribut2' => array(
'Attribut21' => 'att21',
'Attribut22' => 'att22',
...
)
)
),
...
),
...
But when i do it i have this error :
SimpleSAML_Error_Error: UNHANDLEDEXCEPTION
Backtrace:
1 C:\wamp\www\Idp\simplesamlphp\www\_include.php:37 (SimpleSAML_exception_handler)
0 [builtin] (N/A)
Caused by: Exception: Invalid attributes for user userTest in authentication source example-userpass: Invalid attribute value for attribute Attribut2: array (
'Attribut21' => 'att21',
'Attribut22' => 'att22'
)
So how can i add an attribut with other attribut?
Change
'Attribut21' = 'att21',
'Attribut22' = 'att22',
to
'Attribut21' => 'att21',
'Attribut22' => 'att22',
Since they are supposed to be an associative array.
EDIT: ok, not sure what's the problem here... i'm gonna post an example and hopefully you do understand the pattern. (each array is in fact more attributes)
<?php
$config = array(
'example-userpass' => array(
'exampleauth:UserPass',
'student:studentpass' => array(
'uid' => array('student'),
'eduPersonAffiliation' => array('member', 'student'),
),
'employee:employeepass' => array(
'uid' => array('employee'),
'eduPersonAffiliation' => array('member', 'employee'),
),
),
);
It was not really diffcult finally i just have to do :
$config = array(
...
'example-userpass' => array(
'userTest:pwd' => array(
'uid' => array('userTest'),
'NameIdentifier' => 'Test',
'Attribut1' => 'att1',
'Attribut2' => array(
'att21',
'att22',
...
)
)
),
...
),
...
I want to develop a module that add fields to user profile in drupal 7, like phone number and CV ...
and I don't know how to do that (using Database or using fields API)
pls help me.
Any clear tutorials will be appreciated.
Try to follow the following code
$myField_name = "NEW_FIELD_NAME";
if(!field_info_field($myField_name)) // check if the field already exists.
{
$field = array(
'field_name' => $myField_name,
'type' => 'text',
);
field_create_field($field);
$field_instance = array(
'field_name' => $myField_name,
'entity_type' => 'user', // change this to 'node' to add attach the field to a node
'bundle' => 'user', // if chosen 'node', type here the machine name of the content type. e.g. 'page'
'label' => t('Field Label'),
'description' => t(''),
'widget' => array(
'type' => 'text_textfield',
'weight' => 10,
),
'formatter' => array(
'label' => t('field formatter label'),
'format' => 'text_default'
),
'settings' => array(
)
);
field_create_instance($field_instance);
Hope this works... Muhammad.