mercredi 25 janvier 2023

 Settle customer transactions using the CustVendOpenTransManager X++ code


public boolean markInvoicesForSettlement(LedgerJournalTrans  _journalTrans, PaymTransContract _contract)

    {

           CustTrans                custTrans;
        CustTransOpen            custTransOpen;
        boolean                  ret                = true;
        CustVendOpenTransManager settleManager      = CustVendOpenTransManager::construct(_journalTrans);
        SpecTransManager         specTransManager   = settleManager.parmSpecTransManager();
        InvoiceId invoiceId = _journalTrans.ProArMerchantReference;
        CustTable custTable = CustTable::find(_contract.parmAccountCode());
        AmountCur settlementAmount;
            
            
            custTrans     = CustTrans::findFromInvoice(invoiceId, custTable.AccountNum);
            custTransOpen = CustTransOpen::findRefId(custTrans.RecId);
            if (custTransOpen.RecId != 0)
            {
                AmountCur unmarkedAmount = specTransManager.findUnmarkedAmountForRef(custTransOpen.AmountCur,
                                                                                     custTransOpen.company(),
                                                                                     custTransOpen.TableId,
                                                                                     custTransOpen.RecId);
                if (!settleManager.checkTransFullyMarkedByOtherSpec(custTransOpen))
                {
                    if (settlementAmount <= unmarkedAmount)
                    {
                        settleManager.updateTransMarked(custTransOpen, NoYes::Yes);
                        settleManager.updateSettleAmountPaymCur(custTransOpen, settlementAmount);
                        settleManager.settleMarkedTrans();
                    }
          }   
}

mardi 28 juin 2016

Disable financial dimensions in AX 2012 through code

Disable financial dimensions in AX 2012 through code



Disabling particular financial dimension based on record or on particular form quite tricky in AX 2012 compared to AX 2009.

Here is an example to achieve disabling Business unit financial dimension on Customers form in AX 2012.

Process to disable Business Unit financial dimension on Customers form.
1.       Create a new parm method in ‘DimensionDefaultingControllerBase’ class as shown below  

void parmEditableDimensionAttributeSetId(RefRecId _editableDimensionAttributeSetId  = editableDimensionAttributeSetId)
{
    editableDimensionAttributeSetId = _editableDimensionAttributeSetId;
}

2.       Create a new method in ‘CustTable’ form as shown below  

private void setDimensionAttributeSetStorage()
{
    DimensionAttribute              dimAttr;
    DimensionAttributeSetItem       dimAttrSetItem;
    DimensionEnumeration            dimensionSetId = DimensionCache::getDimensionAttributeSetForLedger();
    DimensionAttributeSetStorage    dimensionAttributeSetStorage;
    ;

    dimensionAttributeSetStorage = new DimensionAttributeSetStorage();

    while select * from dimAttr
            order by Name
            where dimAttr.Type != DimensionAttributeType::MainAccount
        join RecId from dimAttrSetItem
            where dimAttrSetItem.DimensionAttribute == dimAttr.RecId &&
                dimAttrSetItem.DimensionAttributeSet == dimensionSetId
    {
        if (dimAttr.Name != 'BusinessUnit'// Except BusinessUnit rest should enable
            dimensionAttributeSetStorage.addItem(dimAttr.RecId, dimAttr.HashKey,NoYes::Yes);
    }

     dimensionDefaultingController.parmEditableDimensionAttributeSetId(dimensionAttributeSetStorage.save());
}

3.       Add below highlighted code in ‘init’ method of ‘CustTable’ form as shown below     
Calling newly created method before dimensionDefaultingController.pageActivated();

dimensionDefaultingController = DimensionDefaultingController::constructInTabWithValues(truetruetrue0, this, tabFinancialDimensions, "@SYS138487");
   dimensionDefaultingController.parmAttributeValueSetDataSource(custTable_ds,fieldStr(CustTable, DefaultDimension));
    // Added by Shankar on 25/11/2013 DisableFinDimensions - Begin
    this.setDimensionAttributeSetStorage();
    // Added by Shankar on 25/11/2013 DisableFinDimensions - End
    dimensionDefaultingController.pageActivated();

4.       Now open Customers form & check financial dimensions tab it shows as below.
Can see Business Unit financial dimension disabled, highlighted one.

 

Hope this topic would be helpful...Enjoy... 

mardi 29 mai 2012

lundi 28 mai 2012

Top reasons why IT projects fail?

Top reasons why IT projects fail?

Why are there so many IT projects fail after spending million of dollars? Here are some of the most common reasons in real life projects.

1.  Lack of an agile process:
Plan big fails big. Agile process identifies critical issues much earlier and allows more time to resolve them before running out of time or budget. Some staff may be skeptical of the changes. Clear vision and determination from the executive is critical. Bring in expertise to implement the first agile process.
 
2.  Unrealistic deadlines & expectations made by executives: 
Under presssure, engineers cave in to the executive demands rather than buy in to the deadlines.  Engineers usually focus on feature completion and neglect performance, scalability and non-functional issues.  Those projects are often not production ready and require far more time to undo the mistakes. All the chaoses make staff retention, especially the good one, challenging.
 
3.  Risk intolerance
IT projects includes many turning parts.  A trouble free project is not only prohibitive expensive but usually counter productive.  The intolerance of mistakes in an IT project  creates a culture of finger pointing and issue hiding.  Risk intolerance usually do not reduce mistakes but rather hinder open and honest communication.
 
4.  Inexperience in realize and manage risk:
Project management requires significant effort in identify and mitigate risk. Many projects fail because problems are identified too late. Hire expertise that understand cross domain issues including development, testing, deployment and operation. Prototype components that use new technology. Integrate early and deploy a working integrated system as early as possible before features completion.
 
5.  Politics between operation and engineering team:
Many projects stall when the engineering team hands over a project to the operation team for deployment.  Relationship worsen when production problem occurs.  During the configuration, deployment and production time, have a full time hands on liaison developer to work closely with the operation team. Engineering team should provide expertise and documentation in application configuration, trouble shooting and operation.
 
6.  Managers need to be hands on and pay due diligence:
Do not expect information presented to the executive is 100% accurate or even honest.   Executives needs to analysis and evaluate the information thoroughly. Be critical. Develop a team of capable expertise that gives direct and high value information. Make tough decision quickly.  In-decisive often causes more damage than making the wrong decision.  
 
7.  Improper scalability and performance testing:
Test early and very early.  Execute the testing at early development phase to prove the core framework can scale and perform.  Non-functional tests take time to develop and should start at the early code development phase.  Comprehensive performance tests take time and expertise to develop.
 
8.  Fail to control & manage changes:
Moving target is counter productive. Introduce an agile process to balance the needs of making changes and a sustainable productivity. Late changes should be reviewed and approved probably before making the requests to the engineers.  Do not under-estimate the side effects of a late change since those changes rarely go through a regression test.
 
9. Do not have the right team and resources:  
Make bold personnel changes to a team inherited from an old project. Bring in new expertise and leadership. A hands-on architect or team lead makes a lot of difference. Invest  time to find a good one. Bring in expertise that can bridge between the database and the middle tier business logic in particular during performance trouble shooting.  Have a architect that have significant configuration, operation and monitoring experience.
 
10. Be proud of what is NOT done as well as what is done:
Deliver 100% of the "must have" rather than a feature infested product.  Focus the team on a smaller must have features.  Many IT projects have feel-good features that end users rarely use.
 
11. Over design: 
Don't over design. Don't handle all possible changes or scenario. 70% of those predictions never materialize. 
 
12. Too much talk but not much action: 
 Adapt a development process that focuses on deliverable. Planning & design phase should not be longer than 20-25% of the overall project time.
 
 By Jonathan Hui

lundi 29 août 2011

Facebook Vs Google+


Google+ was released recently, and the general reaction has been somewhere between “not bad” and “it’s kind of like Facebook, except not.” I’m excited for a few reasons.

My feeling towards Facebook is similar to my feelings towards Microsoft and Research in Motion. I have nothing against either of those companies personally, and I used both Windows and Blackberries for over a decade. But neither Microsoft nor RIM has released a competitive product in years, and as a result, Apple has blown them both out of the water. (If either of them came up with a competitive product, I’d be more than happy to jump back.)

In short, I don’t think Facebook offers a competitive product, but there hasn’t been a competitor to demonstrate why that is, until now. There are a few systemic problems with Facebook:

Facebook still assumes you want to share everything with everyone.

This worked when only your friends were on Facebook, but this isn’t the case anymore, and Facebook hasn’t adapted. It doesn’t give you control over some basic things, like who gets to tag you in photos. I’m sorry, but I don’t want a picture of me downing a Guinness popping up in my third-grade teacher’s News Feed.

I also don’t have a Facebook wall because I can’t easily control who can post publicly to my wall and who can’t. So that means I don’t have a Facebook wall and no tagged photos. (Google+ lets you choose whose tagged photos will be approved and whose won’t.)

I also can’t delete my Facebook account, only “deactivate” it. Not having those options available makes me very leery of Facebook’s store-all, reply-all, tell-all approach to sharing.

Which leads me to my main point. I think it’s genius what Google+ has done with Circles. In the real world, people have subsets of friends. They have good, better, and best friends. They have family and coworkers. These delineations and determinations are sometimes (or usually) made subconsciously, but we all do it.

Google has recognized this and come up with Circles — e.g. Family, Friends, or Acquaintances. That means I can share a slightly inappropriate, wildly funny video with my friends without sharing it with my sisters and my cousins and my aunts. Or I can send my performance of Gilbert & Sullivan’s “When I Was a Lad” to my family without sharing it with my friends. (Just an example!)

You can accomplish this by setting up Friend Lists and Groups in Facebook, but it’s not easy. Furthermore, and more importantly, Facebook fixed the problem backwards. They set up Friends Lists so you could restrict who sees what, assuming you want to share with everyone. Google+ does the opposite, by having you select the people you want to share with on a per-item basis. There’s no way to share something with everyone in Google+. (Whodathunk?)

This makes sense though, doesn’t it? If I run across something, there are only particular people I want to share it with — not my entire address book.

Also, a small thing: after watching Facebook’s new features announcement, I felt bad for them. Their big announcements were Group Chat, New Design, and Video Calling (feat. Skype). Google has all of that covered, in Gmail alone!

It’ll be interesting to see how Google+ develops, but it’s safe to say that Facebook now has real competition.

jeudi 25 août 2011

Zend Vs Symphony !

' After a long discussion with one of my work partner about the right choice between the two frameworks zend and symphony as the two much used framwroks in developping web applications, he tryied to convince me to choose symphony while I try to recommand him Zend.
So we decided to make a fare comparison about the functionnalities of the two system ! '

' Here is a comprehensive comparison between the Symfony Framework and the Zend Framework. '

Like the .Net Framework, Zend is a bucket of functions that, together, provide advanced interfaces to the most complex of tasks that web developers need to write regularly. They then leave the developer to work up a quick interface to the application, which they enable with their views structure. Zend's major strength and weakness is that there isn't one particular way to do things and that you can pick and choose which libraries you want to use.

Both frameworks are PHP5-native frameworks and won't function in PHP4. Both are heavily object-oriented and make use of inheritance that's only offered in PHP>5. Both use the front controller model.

The similarities end there.

Zend uses very little code generation and configuration is all in the front controller; Symfony has a great deal of code generation and a huge amount of configuration overhead. Zend is flexible about it's directory hierarchy and allows you to heavily customize your directories to use global code libraries; Symfony has a required directory structure that is created when you use the command line tool to create modules. Zend doesn't require command-line creation of modules.

After the jump, I'll focus on a few areas where there's some specific differences.

Getting Started

Symfony has a lot of buzz and user support, and there are excellent guides from both the authors and the communities to get users started on the learning curve. Zend doesn't have as much, and the documentation is really directed at more experienced developers who are old hands with the more complex aspects of object-orientation.
Unit Testing

Symfony provides command-line tasks for unit testing and automatically generates a default (empty) testing object for you when you create a module.

Zend doesn't have integrated support for unit testing, but all components that go into the framework require unit tests.

Templating

Zend's templating is immature and doesn't allow easy nesting without a well-documented hack or two, but will in the next release or Soon

Symfony's templating is extremely mature and uses caching extensively to rapidly deliver content to users. You can plug components and entire other modules into slots in your symfony templates, and you can customize the templates as much as you want through the use of layout scripts.

Plugins

Symfony has an extensive plugin and extension community in it's community wiki. Zend, as yet, does not. It's interesting to note that you can pull in the Zend framework's functionality with Symfony by using the Zend Framework plugin for Symfony.
Database Modules

Zend uses the ActiveRecord model for databases. Symfony allows the user to plug in whatever database manager they want, including Zend_Db.

My issues with Symfony is two current frontrunning database plugins (propel and doctrine) include the extensive bugs in both (Propel is issues depend greatly on the lag in changing from Creole to DBO and also the stupidly complex criteron objects, and Doctrine is as of yet an immature project that recently saw it's first 1.0 release.) and the code generation / configuration overhead that you end up with when you're creating hundreds of tables and managing changes to those tables. It gets to be a headache once you get past twenty or thirty tables. Zend is active record implementation is much easier because all you need to do is direct an object at the item.

Source : phpframeworks


mardi 23 août 2011

Drupal Vs Joomla !


Ce matin j'ai eu une discussion avec notre directrice d'opération, elle venait prendre mon avis pour le choix d'un CMS pour la gestion de son contenu, son besoin consistait à mettre en place le plus rapidement possible un blog, un wiki, une base documentaire et un forum de question/réponse, tous ça avec une interface d'administration simple et intuitive pour la mise à jour de son contenu, elle était très inquiète à savoir s'il y a un outil open-source qu'il lui permettra de réaliser cela facilement.

Selon son besoin je lui a recommandé l'un de ces deux CMS Drupal ou Joomla ! mais lequel à choisir, et sur quoi se baser pour faire ce choix !, à ce moment j'ai décidé moi-même de faire une comparaison sur les deux outils.

Langage et mode d'utilisation

Toutefois Drupal et Joomla restent similaires, donc une comparaison directe est beaucoup plus facile. Les deux sont PHP - applications MySQL qui peuvent être utilisés sur l'hébergement mutualisé, et peut être installé à distance. Les deux sont dans les classes de la brochure et la communauté / des nouvelles de la CMS.

L'aspect visuel

Une chose qui doit être signalé, parce que nous parlons d'un support visuel lors de la discussion sites: Joomla est le meilleur CMS visuelle autour. Rien ne peut le battre dans les enjeux de l'apparence. C'est plus rapide et plus facile d'obtenir un site bien sophistiqué avec Joomla qu'avec n'importe quel autre solution, il ya un choix de milliers de modèles, qui peuvent être modifiés et personnalisés sans trop d'effort si vous connaissez un peu de CSS et quelques outils gfx comme un sélecteur de couleur et un soft qui peut créer des jpeg et png art tels que des dégradés et des textures, vous pouvez reconstruire un modèle pour le rendre unique - et plus facilement qu'avec tout autre populaires à base de modèles CMS

Moteur de recherche

Drupal dispose d'un moteur de recherche assez puissant qui lui permet de placer à un niveau supérieur que joomla, si vous concevez un site web pour une petite entreprise, vous pouvez passez à joomla; Comme Joomla est très simple. D'autre part Drupal est plein de techniques ce qui implique que si vous souhaitez l'utiliser vous aurez besoin des connaissances techniques.